1. Technology Field
The present invention relates to a block management method for a flash memory and particularly to a block management method capable of prolonging the lifespan of a flash memory, and a flash memory storage system and a flash memory controller using the method.
2. Description of Related Art
Along with the widespread of digital cameras, cell phones, and MP3 in recently years, the consumers' demand to storage media has increased drastically. Flash memory has the characteristics of data non-volatility, low power consumption, compact size, and non-mechanical structure. Hence, flash memory is adapted for portable appliances, especially portable products powered by batteries. A solid state drive (SSD) is a storage device that uses a NAND flash memory as its storage medium. Flash memory has been widely-used for storing important personal data because it has a larger capacity and a smaller volume. For these reasons, flash memory has become an import part of the electronic industries.
Generally speaking, physical blocks of a flash memory chip in a flash memory storage device are logically grouped into a system area, a data area, a spare area, and a replacement area by a flash memory controller of the flash memory storage device. The physical blocks in the system area are configured to store important relevant information of the flash memory storage system. On the other hand, the physical blocks in the replacement area are configured to replace the damaged physical blocks in the data area or the spare area. Therefore, under a normal access mode, the host system can not access the physical blocks in the system area and the replacement area. The physical blocks grouped into the data area are configured to store valid data written by write commands while physical blocks in the spare area are configured to replace the physical blocks in the data area when the write commands are executed. To be specific, when a flash memory storage device receives a write command from a host system and accordingly is about to update (or write) data in a physical block in the data area, the flash memory storage device first selects a physical block from the spare area, then writes the old valid data in the physical block to be updated in the data area and the new data into the physical block selected from the spare area, logically links the physical block containing the new data to the data area, and eventually erases the physical block to be updated in the data area and logically links it to the spare area. In order to allow the host system to successfully access the physical blocks that are alternatively used to store data described above, the flash memory storage device provides logical blocks to the host system. Namely, the flash memory storage device reflects the substitution of the physical blocks by recording and updating the mappings between the logical blocks and the physical blocks in the data area in a logical address-physical address mapping table. Thus, the host system simply accesses a logical block while the flash memory storage device accesses the corresponding physical block according to the logical address-physical address mapping table.
However, the number of times of erasing the physical blocks of physical units is limited (for instance, the physical blocks will be damaged after ten thousand times of erasing). When one physical block is so highly programmed and erased and becomes damaged, the flash memory controller would mark the physical block which is damaged and stop to use it, and get a new physical block as substitute from the replacement area. In particular, when damaged physical blocks exceed a certain amount with a result that the number of physical blocks becomes insufficient for access of the host system, the flash memory storage device would enter a write protect status or be determined as useless. Thereby, how to prolong the lifespan of a flash memory storage device is one of the major subjects in the industry.
Nothing herein should be construed as an admission of knowledge in the prior art of any portion of the present invention. Furthermore, citation or identification of any document in this application is not an admission that such document is available as prior art to the present invention, or that any reference forms a part of the common general knowledge in the art.